package com.tsingtao.springboot2.api.controller;

import com.tsingtao.springboot2.dto.Employee;
import com.tsingtao.springboot2.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/employee")
public class EmployeeController {

    @Autowired
    private EmployeeService employeeService;

    @GetMapping("/select-all-with-department")
    public List<Employee> selectAllWithDepartment() {
        return employeeService.selectAllWithDepartment();
    }

}
